# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-pysqlite3
_pkgname=pysqlite3
pkgver=0.5.4
pkgrel=1
pkgdesc='DB-API 2.0 interface for Sqlite 3.x.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/pysqlite3/#files'
license=('zlib/libpng')
depends=('python' 'sqlite')
makedepends=('python-pip' 'python-build')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6e74b661e5e0b8d6fe8d444cfd141cff939c25f106777333f5ac3d6dc197840bae02d67defd67d54e8e48626a6ac6821bef082faa6d4adcc6c5f5ee343f86061')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

